﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TechProg
{
  public class rules
  {
//    rule first;
//    public class rule
//    {
      public int prevCondition;
      public int nextCondition;
      public char currentSymbol;
      public char newSymbol;
      public char direction;


      public rules(char CurrentSymbol, char NewSymbol, int PrevCondition, int NextCondition, char Direction)
      {
        currentSymbol = CurrentSymbol;
        newSymbol = NewSymbol;
        prevCondition = PrevCondition;
        nextCondition = NextCondition;
        direction = Direction;
      }

      
  }
//    }
/*    public rules()
    {
      first = null;
      first.nextRule = null;
    }
    
    public void Add(char CurrentSymbol, char NewSymbol, int PrevCondition, int NextCondition, char Direction)
    {
      //добавление перед root
      rule tmpRule = new rule(CurrentSymbol, NewSymbol, PrevCondition, NextCondition, Direction);
      rule p = first;
      while (p.nextRule != null)
      {
        p = p.nextRule;
      }
      p.nextRule = tmpRule;
      tmpRule.nextRule = null;
    }

    public int Delete(int NumFromRoot)
    {
      rule p;
      p = first;
      for (int i = 0; i <= NumFromRoot; i++)
      {
        if (p.nextRule != null)
          p = p.nextRule;
        else
          return 1;
      }
      p.nextRule = p.nextRule.nextRule;
      return 0;
    }      
  }*/
}
